﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true" CodeFile="Editstock.aspx.cs" Inherits="Web_Editstock" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style2
        {
            width: 100%;
        }
        .style4
        {
            width: 374px;
        }
        .style5
        {
            width: 413px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <table class="style2" width="100%">
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style5">
                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text=" Order ID">
                </dx:ASPxLabel>
            </td>
            <td>
                <asp:DropDownList ID="DropDownList1" runat="server" 
                    DataSourceID="SqlDataSource3" DataTextField="Or_ID" DataValueField="Or_ID" 
                    AutoPostBack="True">
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

    <dx:ASPxGridView ID="ASPxGridView2" ClientInstanceName="ASPxGridView2" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1"  KeyFieldName="Or_ID;Pro_Name"
        Width="100%" onrowupdating="ASPxGridView2_RowUpdating">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0" ShowSelectCheckbox="True">
            <HeaderTemplate>
                    <dx:ASPxCheckBox ID="SelectAllCheckBox" runat="server" ToolTip="Select/Unselect all rows on the page"
                        ClientSideEvents-CheckedChanged="function(s, e) {  ASPxGridView2.SelectAllRowsOnPage(s.GetChecked()); }" />
                </HeaderTemplate>
                <HeaderStyle HorizontalAlign="Center" />
            </dx:GridViewCommandColumn>
             <dx:GridViewCommandColumn VisibleIndex="0">
                <EditButton Visible="True">
                </EditButton>
                </dx:GridViewCommandColumn>
                  <dx:GridViewCommandColumn VisibleIndex="0">
                <DeleteButton Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Pro_Name" VisibleIndex="0" 
                Caption="Item">
                <PropertiesComboBox TextField="Pro_Name" ValueField="Pro_Name" EnableSynchronization="False"
                    IncrementalFilteringMode="StartsWith" DataSourceID="SqlDataSource2">
                
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Pur_Price" VisibleIndex="1" 
                Caption="Cost">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="2" 
                Caption="Description">

            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Qty" VisibleIndex="3" Caption="Quantity">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Caption="Status" FieldName="status" 
                VisibleIndex="5">
                <PropertiesComboBox ValueType="System.String">
                    <Items>
                        <dx:ListEditItem Text="Recevied" Value="Recevied" />
                        <dx:ListEditItem Text="Cancelled" Value="Cancelled" />
                    </Items>
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Or_ID" VisibleIndex="8" Visible="False">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" />
        <images spritecssfilepath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <loadingpanelonstatusbar url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </loadingpanelonstatusbar>
            <loadingpanel url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </loadingpanel>
        </images>
        <imagesfiltercontrol>
            <loadingpanel url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </loadingpanel>
        </imagesfiltercontrol>
        <styles cssfilepath="~/App_Themes/BlackGlass/{0}/styles.css" 
            csspostfix="BlackGlass">
            <header imagespacing="5px" sortingimagespacing="5px">
            </header>
        </styles>
        <styleseditors>
            <calendarheader spacing="1px">
            </calendarheader>
            <progressbar height="25px">
            </progressbar>
        </styleseditors>
    </dx:ASPxGridView>
    <table class="style2" width="100%">
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style4">
                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Aprrove">
                </dx:ASPxLabel>
            </td>
            <td>
                <asp:DropDownList ID="DropDownList2" runat="server">
                    <asp:ListItem>YES</asp:ListItem>
                    <asp:ListItem>NO</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style4">
                <dx:ASPxLabel ID="ASPxLabel4" runat="server" ForeColor="Red">
                </dx:ASPxLabel>
                <dx:ASPxLabel ID="ASPxLabel5" runat="server" ForeColor="#009933" 
                    Visible="False">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxButton ID="ASPxButton1" runat="server" ClientIDMode="AutoID" 
                    CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
                    SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" Text="Submit" 
                    onclick="ASPxButton1_Click">
                </dx:ASPxButton>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        
        
        SelectCommand="SELECT Or_ID, Pro_Name, Pur_Price, Description, Qty, status, manger_status FROM Tbl_GRNrequest WHERE (Or_ID = @Or_ID) AND (manger_status IS NULL) OR (manger_status = @status)">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="Or_ID" 
                PropertyName="SelectedValue" Type="String" />
            <asp:Parameter DefaultValue="NO" Name="status" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
                    SelectCommand="SELECT [Or_ID] FROM [Tbl_GRN] WHERE ([status] IS NULL)">
                </asp:SqlDataSource>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        SelectCommand="SELECT Pro_Name FROM Tbl_Product" >

          </asp:SqlDataSource>

</asp:Content>

